home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 May / EnigmA AMIGA RUN 18 (1997)(G.R. Edizioni)(IT)[!][issue 1997-05][EAR-CD II].iso / earcd / misc / emu / arosdev.lha / AROS / rom / utility / taginarray.c < prev    next >
C/C++ Source or Header  |  1997-01-27  |  2KB  |  82 lines

  1. /*
  2.     $Id: taginarray.c,v 1.4 1997/01/27 00:32:33 ldp Exp $
  3.     $Log: taginarray.c,v $
  4.     Revision 1.4  1997/01/27 00:32:33  ldp
  5.     Polish
  6.  
  7.     Revision 1.3  1996/12/10 14:00:16  aros
  8.     Moved #include into first column to allow makedepend to see it.
  9.  
  10.     Revision 1.2  1996/10/24 15:51:38  aros
  11.     Use the official AROS macros over the __AROS versions.
  12.  
  13.     Revision 1.1  1996/10/22 04:46:01  aros
  14.     Some more utility.library functions.
  15.  
  16.     Desc:
  17.     Lang: english
  18. */
  19. #include "utility_intern.h"
  20. #include <utility/tagitem.h>
  21.  
  22. /*****************************************************************************
  23.  
  24.     NAME */
  25. #include <proto/utility.h>
  26.  
  27.         AROS_LH2(BOOL, TagInArray,
  28.  
  29. /*  SYNOPSIS */
  30.         AROS_LHA(Tag  , tagValue, D0),
  31.         AROS_LHA(Tag *, tagArray, A0),
  32.  
  33. /*  LOCATION */
  34.         struct UtilityBase *, UtilityBase, 15, Utility)
  35.  
  36. /*  FUNCTION
  37.         Determines whether the value tagValue exists in an array of Tags
  38.         pointed to by tagArray. This array must be contiguous, and must be
  39.         terminated by TAG_DONE.
  40.  
  41.         This is an array of Tags (ie: Tag tagArray[]), not an array of
  42.         TagItems (ie: struct TagItem tagArray[]).
  43.  
  44.     INPUTS
  45.         tagValue    -   The value of the Tag to search for.
  46.         tagArray    -   The ARRAY of Tag's to scan through.
  47.  
  48.     RESULT
  49.         TRUE    if tagValue exists in tagArray
  50.         FALSE   otherwise
  51.  
  52.     NOTES
  53.  
  54.     EXAMPLE
  55.  
  56.     BUGS
  57.  
  58.     SEE ALSO
  59.         <utility/tagitem.h>, FilterTagItems()
  60.  
  61.     INTERNALS
  62.  
  63.     HISTORY
  64.         29-10-95    digulla automatically created from
  65.                             utility_lib.fd and clib/utility_protos.h
  66.         01-09-96    iaint   Implemented from autodoc.
  67.  
  68. *****************************************************************************/
  69. {
  70.     AROS_LIBFUNC_INIT
  71.  
  72.     while(*tagArray != TAG_DONE)
  73.     {
  74.         if(*tagArray == tagValue)
  75.             return TRUE;
  76.         tagArray++;
  77.     }
  78.     return FALSE;
  79.  
  80.     AROS_LIBFUNC_EXIT
  81. } /* TagInArray */
  82.